#include "vcd-css.h"
#include "vcd-linux-ui/vcd-start-window.h"
#include "vcd-common.h"

void set_start_window_css(GtkWidget *button_quit, GtkWidget *btn_sys_set)
{
#ifndef __linux__
    set_img(g_start_window->main_window_handle, "window", "loginwindow-windows.png");
    set_img(g_start_window->header, "headerbar", "loginwindow.png");
    set_css(g_start_window->entry_node, "entry{border-radius:3px; padding-left:13px}");

    //if (PRIVATE_LOGIN == login_way) {
    if (1) {
        set_css(g_start_window->login_type, "button{color:transparent}");
        set_img(g_start_window->login_type,"button","logintype-1.png");
        set_css(g_start_window->login_type, "button:hover{border:none;box-shadow: 3px 3px 5px alpha(#3b7db6,0.5) inset}");
        set_img(g_start_window->login_type,"button:hover","logintype-2.png");
        gtk_widget_set_tooltip_text(g_start_window->login_type, "切换至公有云");
    } else {
        set_css(g_start_window->login_type, "button{color:transparent}");
        set_img(g_start_window->login_type,"button","logintype-2.png");
        set_css(g_start_window->login_type, "button:hover{border:none;box-shadow: 3px 3px 5px alpha(#3b7db6,0.5) inset}");
        set_img(g_start_window->login_type,"button:hover","logintype-1.png");
        gtk_widget_set_tooltip_text(g_start_window->login_type, "切换至私有云");
    }

#else
    set_img(g_start_window->main_window_handle, "window", "loginwindow.png");
    set_css(button_quit, "button{ border-radius:0px;color:transparent}");
    set_img(button_quit, "button", "guanji-2.png");
    set_css(button_quit, "button:hover{ border-radius:0px;border:none;box-shadow:3px 3px 5px alpha(#3b7db6,0.5) inset}");
    set_img(button_quit, "button:hover", "guanji-1.png");
    set_css(btn_sys_set, "button{ border-radius:0px;color:transparent}");
    set_img(btn_sys_set, "button", "shezhi-2.png");
    set_css(btn_sys_set, "button:hover{ border-radius:0px;border:none;box-shadow:3px 3px 5px alpha(#3b7db6,0.5) inset}");
    set_img(btn_sys_set, "button:hover", "shezhi-1.png");
    set_css(g_start_window->label_ip_node, "label{color:rgb(200,200,200)}");
#endif
    set_css(g_start_window->entry_passwd, "entry{border-radius:0px}");
    set_css(g_start_window->entry_user, "entry{border-radius:0px}");
    set_css(g_start_window->remember_passwd, "checkbutton{color:rgb(200,200,200)}");
    set_css(g_start_window->auto_login, "checkbutton{color:rgb(200,200,200)}");

}

void set_start_window_show_wait_css(GtkWidget *btnyes)
{
    set_css(g_start_window->show_wait_win, "window{border-radius:0px;background-color: rgb(255, 255, 255)}");
    set_css(btnyes, "button{color: white;background: rgb(53, 126, 169);border: 1px solid rgb(40, 94, 142);border-radius: 0px}");
    set_css(btnyes, "button:hover{border-radius:0px;background: #3070a9}");
}

void set_logined_window_running_css(GtkWidget *btn)
{
    set_css(btn, "button{ border-radius:0px;color:transparent}");
    set_img(btn, "button", "win.png");
    set_css(btn, "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6, 0.5) inset}");
    set_img(btn, "button:hover", "hover_win.png");
}

void set_logined_window_stop_css(GtkWidget *btn)
{
    set_css(btn, "button{ border-radius:0px;color:transparent}");
    set_img(btn, "button", "dis_win.png");
    set_css(btn, "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6, 0.5) inset}");
    set_img(btn, "button:hover", "hover_win.png");
}

void set_logined_linux_running_css(GtkWidget *btn)
{
    set_css(btn, "button{ border-radius:0px;color:transparent}");
    set_img(btn, "button", "linux.png");
    set_css(btn, "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6, 0.5) inset}");
    set_img(btn, "button:hover", "hover_linux.png");
}

void set_logined_linux_stop_css(GtkWidget *btn)
{
    set_css(btn, "button{ border-radius:0px;color:transparent}");
    set_img(btn, "button", "dis_linux.png");
    set_css(btn, "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6, 0.5) inset}");
    set_img(btn, "button:hover", "hover_linux.png");
}

void set_logined_public_window_running_css(GtkWidget *btn)
{
    set_css(btn, "button{ border-radius:0px;color:transparent}");
    set_img(btn, "button", "win.png");
    set_css(btn, "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6, 0.5) inset}");
    set_img(btn, "button:hover", "hover_win.png");
}

void set_logined_public_window_stop_css(GtkWidget *btn)
{
    set_css(btn, "button{ border-radius:0px;color:transparent}");
    set_img(btn, "button", "dis_win.png");
    set_css(btn, "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6, 0.5) inset}");
    set_img(btn, "button:hover", "hover_win.png");
}

void set_logined_public_linux_running_css(GtkWidget *btn)
{
    set_css(btn, "button{ border-radius:0px;color:transparent}");
    set_img(btn, "button", "linux.png");
    set_css(btn, "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6, 0.5) inset}");
    set_img(btn, "button:hover", "hover_linux.png");
}

void set_logined_public_linux_stop_css(GtkWidget *btn)
{
    set_css(btn, "button{ border-radius:0px;color:transparent}");
    set_img(btn, "button", "dis_linux.png");
    set_css(btn, "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6, 0.5) inset}");
    set_img(btn, "button:hover", "hover_linux.png");
}

void set_logined_window_css(GtkWidget *win, GtkWidget *btn_left, GtkWidget *btn_right, GtkWidget *btn_exit, GtkWidget *btn_grade, GtkWidget* btn_fresh)
{
    set_img(win, "window", "mainwindow.png");

    set_css(btn_left,  "button{ border-radius:0px;color:transparent}");
    set_img(btn_left,  "button", "left.png");
    set_css(btn_left,  "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6, 0.5) inset}");
    set_img(btn_left,  "button:hover", "left-.png");

    set_css(btn_right, "button{ border-radius:0px;color:transparent}");
    set_img(btn_right, "button", "right.png");
    set_css(btn_right, "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6, 0.5) inset}");
    set_img(btn_right, "button:hover", "right-.png");

    set_css(btn_exit, "button{ border-radius:0px;color:transparent}");
    set_img(btn_exit, "button", "dengchu-2.png");
    set_css(btn_exit, "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6,0.5) inset}");
    set_img(btn_exit, "button:hover", "dengchu-1.png");

    set_css(btn_grade, "button{ border-radius:0px;color:transparent}");
    set_img(btn_grade, "button", "gaoji-2.png");
    set_css(btn_grade, "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6,0.5) inset}");
    set_img(btn_grade, "button:hover", "gaoji-1.png");

    set_css(btn_fresh, "button{ border-radius:0px;color:transparent}");
    set_img(btn_fresh, "button", "fresh-2.png");
    set_css(btn_fresh, "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6,0.5) inset}");
    set_img(btn_fresh, "button:hover", "fresh-1.png");
}

void set_logined_window_down_css(GtkWidget *btn_exit, GtkWidget *btn_grade,GtkWidget* btn_fresh)
{
    set_css(btn_exit, "button{ border-radius:0px;color:transparent}");
    set_img(btn_exit, "button", "dengchu-2.png");
    set_css(btn_exit, "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6,0.5) inset}");
    set_img(btn_exit, "button:hover", "dengchu-1.png");

    set_css(btn_grade, "button{ border-radius:0px;color:transparent}");
    set_img(btn_grade, "button", "gaoji-2.png");
    set_css(btn_grade, "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6,0.5) inset}");
    set_img(btn_grade, "button:hover", "gaoji-1.png");

    set_css(btn_fresh, "button{ border-radius:0px;color:transparent}");
    set_img(btn_fresh, "button", "fresh-2.png");
    set_css(btn_fresh, "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6,0.5) inset}");
    set_img(btn_fresh, "button:hover", "fresh-1.png");
}
void set_logined_window_left_right_css(GtkWidget *btn_left, GtkWidget *btn_right)
{
    set_css(btn_left,  "button{ border-radius:0px;color:transparent}");
    set_img(btn_left,  "button", "left.png");
    set_css(btn_left,  "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6, 0.5) inset}");
    set_img(btn_left,  "button:hover", "left-.png");

    set_css(btn_right, "button{ border-radius:0px;color:transparent}");
    set_img(btn_right, "button", "right.png");
    set_css(btn_right, "button:hover{ border-radius:0px;border:none;box-shadow: 3px 3px 5px alpha(#3b7db6, 0.5) inset}");
    set_img(btn_right, "button:hover", "right-.png");
}

void set_logined_window_grade_window_css(GtkWidget *grade_window, GtkWidget *label_grade, GtkWidget *btnquit)
{
    set_css(grade_window, "window{ background-color:rgb(255,255,255);border-radius:0px}");
    set_css(label_grade,  "label{ border-radius:0px}");
    set_css(btnquit,      "button{ border-radius:0px;}");
    set_css(btnquit,      "button:hover{ border-radius:0px;border:none;box-shadow:3px 3px 5px alpha(rgb(150,150,150),0.5) inset}");
}

void set_usb_redir_css(GtkWidget *window, GtkWidget *btn)
{
    set_img(window,"window","mainwindow.png");

    set_css(btn, "button{border-radius:0px;color:transparent}");
    set_img(btn, "button", "sysquit-1.png");
    set_css(btn, "button:hover{border-radius:0px;border:none;box-shadow:3px 3px 5px alpha(rgb(50,50,50),0.5) inset}");
    set_img(btn, "button:hover", "sysquit-2.png");
}
